<?php

/**
 * Comercios form base class.
 *
 * @package    tercermilenio
 * @subpackage form
 * @author     Your name here
 */
class BaseComerciosForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'com_id'            => new sfWidgetFormInputHidden(),
      'com_razon_social'  => new sfWidgetFormInput(),
      'com_nombre'        => new sfWidgetFormInput(),
      'com_cuit'          => new sfWidgetFormInput(),
      'com_localidad'     => new sfWidgetFormPropelChoice(array('model' => 'Localidades', 'add_empty' => true)),
      'com_telefono1'     => new sfWidgetFormInput(),
      'com_telefono2'     => new sfWidgetFormInput(),
      'com_fax'           => new sfWidgetFormInput(),
      'com_sitio_web'     => new sfWidgetFormInput(),
      'com_email'         => new sfWidgetFormInput(),
      'com_codigo_postal' => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'com_id'            => new sfValidatorPropelChoice(array('model' => 'Comercios', 'column' => 'com_id', 'required' => false)),
      'com_razon_social'  => new sfValidatorString(array('max_length' => 100)),
      'com_nombre'        => new sfValidatorString(array('max_length' => 100)),
      'com_cuit'          => new sfValidatorString(array('max_length' => 30)),
      'com_localidad'     => new sfValidatorPropelChoice(array('model' => 'Localidades', 'column' => 'loc_id', 'required' => false)),
      'com_telefono1'     => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'com_telefono2'     => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'com_fax'           => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'com_sitio_web'     => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'com_email'         => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'com_codigo_postal' => new sfValidatorString(array('max_length' => 10, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('comercios[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Comercios';
  }


}
